package com.cai.servlet.user;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

/**
 * @author RuoLi
 * 退出
 */
@WebServlet(name = "ServletQuit", value = "/quit")
public class ServletQuit extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        HttpSession httpSession = request.getSession();
        httpSession.removeAttribute("user");
        httpSession.removeAttribute("sendUser");
        httpSession.removeAttribute("sendDate");
        httpSession.removeAttribute("sendTime");
        response.sendRedirect("adminLogin.jsp");
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }
}
